<template>
  <avue-form ref="form"
             :option="option"
             v-model="form"
             @submit="handleSubmit">
    <template #menu-form="{size}">
      <el-button type="primary"
                 :size="size"
                 @click="$refs.form.submit()">自定义提交</el-button>
      <el-button :size="size"
                 @click="$refs.form.resetForm()">自定义清空</el-button>
    </template>
  </avue-form>
</template>
<script>
export default {
  data () {
    return {
      form: {},
      option: {
        submitBtn: false,
        emptyBtn: false,
        column: [{
          label: "用户名",
          prop: "username"
        }]
      }
    }
  },
  methods: {
    handleSubmit (form, done) {
      this.$message.success('3s后关闭');
      setTimeout(() => {
        done()
      }, 3000)
    }
  }
}
</script>